package cn.bugio.note.controller.content;

import cn.bugio.note.auth.CheckAuth;
import cn.bugio.note.common.domain.dto.ShareDTO;
import cn.bugio.note.common.vo.ServerResponse;
import cn.bugio.note.domain.dto.content.ShareAuditDTO;
import cn.bugio.note.service.content.ShareService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Vincent Vic
 * @version 1.0
 * @Description
 * @since 2021/2/16
 */

@RestController
@RequestMapping("/admin/shares/")
@Slf4j
public class ShareAdminController {

    @Autowired
    private ShareService shareService;

    @PutMapping("audit/{id}")
    @ResponseBody
    @CheckAuth("admin")
    public ServerResponse<ShareDTO> auditById(@PathVariable Integer id, ShareAuditDTO auditDTO){
        log.info("请求id: {}",id);
        //TODO 认证、授权


        return shareService.auditById(id,auditDTO);
    }


}
